]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: Simplify some code
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 31 May 2013 18:00:17 +0000 (20:00 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 31 May 2013 22:35:24 +0000 (00:35 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=701386

js/ui/dash.js

index 0de00a29c6a9adf10b64edadd9ddba144fd27213..e29aff4041721f30d700b4e4f57c5eed0386533f 100644 (file)
@@ -287,13 +287,7 @@ const ShowAppsIcon = new Lang.Class({
     },
 
     handleDragOver: function(source, actor, x, y, time) {
-        let app = getAppFromSource(source);
-        if (app == null)
-            return DND.DragMotionResult.NO_DROP;
-
-        let id = app.get_id();
-        let isFavorite = AppFavorites.getAppFavorites().isFavorite(id);
-        if (!isFavorite)
+        if (!this._canRemoveApp(getAppFromSource(source)))
             return DND.DragMotionResult.NO_DROP;
 
         return DND.DragMotionResult.MOVE_DROP;
@@ -301,7 +295,7 @@ const ShowAppsIcon = new Lang.Class({
 
     acceptDrop: function(source, actor, x, y, time) {
         let app = getAppFromSource(source);
-        if (app == null)
+        if (!this._canRemoveApp(app))
             return false;
 
         let id = app.get_id();